import request from "@/plugins/request";

var pre = "/inteCater/foodBeverages/electronMealticket";

if (process.env.NODE_ENV !== "development") {
    pre = "/api/sa/smar-catering" + pre;
}


// 获取当前用户申请
export function getPage(data) {
    return request({
        url: `${pre}/getPage`,
        method: "post",
        data
    });
}

// 新增申请
export function add(data) {
    return request({
        url: `${pre}/add`,
        method: "post",
        data
    });
}


// 修改申请
export function edit(data) {
    return request({
        url: `${pre}/edit`,
        method: "post",
        data
    });
}


// 根据id删除申请
export function deleteById(data) {
    return request({
        url: `${pre}/delById`,
        method: "post",
        data
    });
}

// 根据id获取申请明细信息
export function getDetailInfoById(data) {
    return request({
        url: `${pre}/getDetailInfoById`,
        method: "post",
        data
    });
}

// 根据id获取申请明细信息
export function getInfoById(data) {
    return request({
        url: `${pre}/getInfoById?mealticketId=${data}`,
        method: "get"
    });
}


// 提交
export function editStatus(data) {
    return request({
        url: `${pre}/editStatus`,
        method: "post",
        data
    });
}

// 根据食堂id获取餐券有效时间
export function getDay(data) {
    return request({
        url: `${pre}/getDay?canteenId=${data}`,
        method: "get"
    });
}


// 根据No获取申请信息
export function getInfoByNo(data) {
    return request({
        url: `${pre}/getInfoByNo?appNo=${data}`,
        method: "get"
    });
}



// 流转到下一环节
export function editNextNode(data) {
    return request({
        url: `${pre}/editNextNode`,
        method: "post",
        data
    });
}

// 流转到下一环节
export function getDetailAllInfoById(data) {
    return request({
        url: `${pre}/getDetailAllInfoById?mealticketId=${data}`,
        method: "get"
    });
}